package com.yswy.common.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author baggio
 * @description 申请状态
 */
public enum TgAccessEnums {

	PUSH(1, "push" , "a_oId" , "推呀支付页"),
    PUSHLD(1, "pushld" , "a_oId" , "推呀落地页"),
    MYCAT(5, "mycat","bxm_id","变现猫"),
    XMOB(7, "mbt","mob_cid","XMOB"),
    JZ(6, "jz","jcid","极准"),
    BCHUAN(4, "bchuan","bc_tag","百川"),
    CWTG(4, "cwtg","","cwtg"),
    DM(4, "dm","dm_id","多盟"),
    ZYLD(8, "zyld","octid","章鱼落地页"),
    ZY(8, "zy","octid","章鱼支付页"),
    GQ(9, "gq","ccbid","广趣"),
    AITU(12, "aitu","ccbid","艾推"),
    HDT(3, "hdt" ,"utm_click","互动推"),
    XYKS(3, "xyks" ,"callback","新远快手")
    ;


    TgAccessEnums(int code, String message , String tgId  , String jsMsg) {
        this.code = code;
        this.message = message;
        this.tgId = tgId;
        this.jsMsg = jsMsg;
    }

    private final int code;

    private final String message;

    private final String tgId;
    private final String jsMsg;

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
    public String getTgId() {
        return this.tgId;
    }
    public String getJsMsg() {
        return this.jsMsg;
    }

    public String getTgId(String access) {
        if (access.contains(PUSH.getMessage())){
            return PUSH.getTgId();
        }
        if (access.contains(MYCAT.getMessage())){
            return MYCAT.getTgId();
        }
        if (access.contains(XMOB.getMessage())){
            return XMOB.getTgId();
        }
        if (access.contains(BCHUAN.getMessage())){
            return BCHUAN.getTgId();
        }

        if (access.contains(DM.getMessage())){
            return DM.getTgId();
        }

        if (access.contains(ZY.getMessage())){
            return ZY.getTgId();
        }

        if (access.contains(GQ.getMessage())){
            return GQ.getTgId();
        }

        if (access.contains(JZ.getMessage())){
            return JZ.getTgId();
        }
        if (access.contains(ZYLD.getMessage())){
            return ZYLD.getTgId();
        }
        if (access.contains(AITU.getMessage())){
            return AITU.getTgId();
        }
        if (access.contains(HDT.getMessage())){
            return HDT.getTgId();
        }
        if (access.contains(XYKS.getMessage())){
            return XYKS.getTgId();
        }



        return null;
    }


    public static List<Map<String  , Object>> getTGManage() {
        List<Map<String  , Object>> mapList = new ArrayList<>();
        Map<String  , Object> PUSHmap = new HashMap<>();
        PUSHmap.put("code" , PUSH.getMessage());
        PUSHmap.put("msg" , PUSH.getJsMsg());

        Map<String  , Object> PUSHLDmap = new HashMap<>();
        PUSHLDmap.put("code" , PUSHLD.getMessage());
        PUSHLDmap.put("msg" , PUSHLD.getJsMsg());

        Map<String  , Object> MYCATmap = new HashMap<>();
        MYCATmap.put("code" , MYCAT.getMessage());
        MYCATmap.put("msg" , MYCAT.getJsMsg());

        Map<String  , Object> XMOBmap = new HashMap<>();
        XMOBmap.put("code" , XMOB.getMessage());
        XMOBmap.put("msg" , XMOB.getJsMsg());

        Map<String  , Object> BCHUANmap = new HashMap<>();
        BCHUANmap.put("code" , BCHUAN.getMessage());
        BCHUANmap.put("msg" , BCHUAN.getJsMsg());

        Map<String  , Object> CWTGmap = new HashMap<>();
        CWTGmap.put("code" , CWTG.getMessage());
        CWTGmap.put("msg" , CWTG.getJsMsg());

        Map<String  , Object> JZmap = new HashMap<>();
        JZmap.put("code" , JZ.getMessage());
        JZmap.put("msg" , JZ.getJsMsg());

        Map<String  , Object> DMmap = new HashMap<>();
        DMmap.put("code" , DM.getMessage());
        DMmap.put("msg" , DM.getJsMsg());

        Map<String  , Object> ZYmap = new HashMap<>();
        ZYmap.put("code" , ZY.getMessage());
        ZYmap.put("msg" , ZY.getJsMsg());

        Map<String  , Object> GQmap = new HashMap<>();
        GQmap.put("code" , GQ.getMessage());
        GQmap.put("msg" , GQ.getJsMsg());

        Map<String  , Object> ZAYUZFmap = new HashMap<>();
        ZAYUZFmap.put("code" , ZYLD.getMessage());
        ZAYUZFmap.put("msg" , ZYLD.getJsMsg());

        Map<String  , Object> AITUmap = new HashMap<>();
        AITUmap.put("code" , AITU.getMessage());
        AITUmap.put("msg" , AITU.getJsMsg());

        Map<String  , Object> HDTmap = new HashMap<>();
        HDTmap.put("code" , HDT.getMessage());
        HDTmap.put("msg" , HDT.getJsMsg());

        Map<String  , Object> XYKSmap = new HashMap<>();
        XYKSmap.put("code" , XYKS.getMessage());
        XYKSmap.put("msg" , XYKS.getJsMsg());


        mapList.add(PUSHLDmap);
        mapList.add(CWTGmap);
        mapList.add(PUSHmap);
        mapList.add(MYCATmap);
        mapList.add(XMOBmap);
        mapList.add(BCHUANmap);
        mapList.add(JZmap);
        mapList.add(DMmap);
        mapList.add(ZYmap);
        mapList.add(GQmap);
        mapList.add(ZAYUZFmap);
        mapList.add(AITUmap);
        mapList.add(HDTmap);
        mapList.add(XYKSmap);
        return  mapList ;
    }
}
